import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
    home: Scaffold(
      appBar: AppBar(
        title: const Text("Indicator Demo"),
      ),
      body: ConstraintBoxWidget(),
    ),
  ));
}

class ConstraintBoxWidget extends StatelessWidget {

  @override
  Widget build(BuildContext context) {
    return ConstrainedBox(
      constraints: const BoxConstraints(
        minWidth: double.infinity,
        minHeight: 50.0,
      ),
      child: Container(
        // Container的高度设置为5像素，但是最终却是50像素，这正是ConstrainedBox的最小高度限制生效了
        height: 5.0,
        child: null,
        color: Colors.red,
      ),
    );
  }
}